
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>安装JENKINS · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="install_jenkins_config.html" />
    
    
    <link rel="prev" href="install_kubernetes.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="install_required.html">
            
                <a href="install_required.html">
            
                    
                    安装环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="install_docker_ce.html">
            
                <a href="install_docker_ce.html">
            
                    
                    安装DockerCE
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="install_rancher.html">
            
                <a href="install_rancher.html">
            
                    
                    安装Rancher
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="install_kubernetes.html">
            
                <a href="install_kubernetes.html">
            
                    
                    安装Kubernetes
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.6" data-path="install_jenkins.html">
            
                <a href="install_jenkins.html">
            
                    
                    安装JENKINS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="install_jenkins_config.html">
            
                <a href="install_jenkins_config.html">
            
                    
                    配置JENKINS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="install_mysql.html">
            
                <a href="install_mysql.html">
            
                    
                    安装MYSQL
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >安装JENKINS</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>Docker &#x76F4;&#x63A5;&#x542F;&#x52A8;&#xFF1A;</p>
<pre><code>sudo docker run -d --name jenkins -p 18080:8080 -p 50000:50000 -v /z/data/jenkins/:/var/jenkins_home jenkinsci/blueocean
</code></pre><p>jenkins-rc.yaml</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: jenkins
spec:
replicas: 1
template:
metadata:
labels:
app: jenkins
spec:
containers:
- name: jenkins
image: jenkinsci/blueocean:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
name: web
protocol: TCP
- containerPort: 50000
name: agent
protocol: TCP
volumeMounts:
- name: jenkinshome
mountPath: /var/jenkins_home
env:
- name: JAVA_OPTS
value: &quot;-Duser.timezone=Asia/Shanghai&quot;
volumes:
- name: jenkinshome
hostPath:
path: /z/data/jenkins/
</code></pre><p><code>kubectl create -f jenkins-rc.yaml</code></p>
<p>jenkins-service.yml</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: jenkins
spec:
selector:
app: jenkins
ports:
- name: http
port: 18080 #external access port
protocol: TCP
targetPort: 8080 #container port
externalIPs:
- 192.168.200.171
</code></pre><p>&#x67E5;&#x770B;deployments</p>
<pre><code>kubectl get deployments
</code></pre><p><img src="http://p3qc0n3z5.bkt.clouddn.com/18-2-6/54542160.jpg" alt=""></p>
<pre><code>kubectl get pods
</code></pre><p><img src="http://p3qc0n3z5.bkt.clouddn.com/18-2-6/99618633.jpg" alt=""></p>
<pre><code>kubectl get services
</code></pre><p><img src="http://p3qc0n3z5.bkt.clouddn.com/18-2-6/9064553.jpg" alt=""></p>
<p><img src="http://p3qc0n3z5.bkt.clouddn.com/18-2-6/2642811.jpg" alt=""></p>
<p>&#x6D4F;&#x89C8;&#x5668;&#x8BBF;&#x95EE;&#xFF1A;<a href="http://192.168.200.171:32264" target="_blank">http://192.168.200.171:</a>18080</p>
<p><img src="http://p3qc0n3z5.bkt.clouddn.com/18-2-6/28971042.jpg" alt="">
&#x83B7;&#x53D6;&#x5BC6;&#x7801;&#xFF1A;</p>
<p>kubectl log -f jenkins-5cc4b46669-lvcvr</p>
<p><img src="http://p3qc0n3z5.bkt.clouddn.com/18-2-6/1703576.jpg" alt=""></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="install_kubernetes.html" class="navigation navigation-prev " aria-label="Previous page: 安装Kubernetes">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="install_jenkins_config.html" class="navigation navigation-next " aria-label="Next page: 配置JENKINS">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"安装JENKINS","level":"1.6","depth":1,"next":{"title":"配置JENKINS","level":"1.7","depth":1,"path":"install_jenkins_config.md","ref":"install_jenkins_config.md","articles":[]},"previous":{"title":"安装Kubernetes","level":"1.5","depth":1,"path":"install_kubernetes.md","ref":"install_kubernetes.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"install_jenkins.md","mtime":"2018-02-06T13:24:57.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-03-20T03:22:54.300Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

